package main

import "fmt"

// Monkey结构体
type Monkey struct {
	Name string
}

// 声明接口
type BirdAble interface {
	Flying()
}

type FishAble interface {
	Swimming()
}

func (this *Monkey) climbing() {
	fmt.Println(this.Name, " 生来会爬树。。。")
}

// LittleMonkey 结构体
type LittleMonkey struct {
	Monkey
}

// 让LittleMonkey 实现了BirdAble
func (this *LittleMonkey) Flying() {

	fmt.Println(this.Name, " 通过学习，学会了飞翔，，，")
}

func (this *LittleMonkey) Swimming() {

	fmt.Println(this.Name, " 通过学习，学会了游泳 。。。。")
}

// 主方法
func main() {

	// 创建一个LittleMonkey 实例
	monkey := LittleMonkey{
		Monkey{
			Name: "孙悟空",
		},
	}

	monkey.climbing()
	monkey.Flying()
	monkey.Swimming()
}
